#include "DAL.h"

EntityTable CreateEntityTable(const String* Entities, unsigned int Size)
{
	unsigned int i;
	String* newEntities = malloc(sizeof(String) * Size);

	for (i = 0; i < Size; i++)
	{
		newEntities[i] = malloc((strlen(Entities[i]) + 1));
		strcpy(newEntities[i], Entities[i]);
	}

	EntityTable newEntityTable;

	newEntityTable.Size = Size;
	newEntityTable.Entities = newEntities;

	return newEntityTable;
}

void DestructEntityTable(EntityTable EntityTable)
{
	unsigned int i;
	for (i = 0; i < EntityTable.Size; i++)
		free(EntityTable.Entities[i]);

	free(EntityTable.Entities);
}